﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PictbaseAirApi;
using PictbaseSharePointLibrary;

namespace PictbaseConsole
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            //ToSharePoint();
            
            FromSharePoint();
        }

        static void ToSharePoint()
        {
            PictbaseDataSync sync = new PictbaseDataSync()
            {
                //SharePointSiteUrl = "http://server1",
                SharePointSiteUrl = "https://icombs.sharepoint.com/demo_merch",

                SharePointAd = "spdev2",
                SharePointLogin = "administrator",
                SharePointPwd = "P@ssw0rd",
                SharePointList = "Test",

                Claims = true,

                PictbaseUrl = "http://www.pictbase-air.com/rest/v2.0",
                PictbaseLogin = "walid.hadjadj@devparam.com",
                PictbasePwd = "demo_pass",
                PictbaseStructureId = 1611
            };
            sync.Init();

            sync.SyncPictbaseToSharePoint();
        }

        static void FromSharePoint()
        {
            PictbaseDataSync sync = new PictbaseDataSync()
            {
                //SharePointSiteUrl = "http://server1",
                SharePointSiteUrl = "https://icombs.sharepoint.com/demo_merch",

                SharePointAd = "spdev2",
                SharePointLogin = "administrator",
                SharePointPwd = "P@ssw0rd",
                
                SharePointList = "Tâches",

                Claims = true,

                PictbaseUrl = "http://www.pictbase-air.com/rest/v2.0",
                PictbaseLogin = "walid.hadjadj@devparam.com",
                PictbasePwd = "demo_pass",
                PictbaseStructureId = 1611
            };
            sync.Init();

            sync.SyncSharePointToPictbase();
        }
    }
}
